package com.example.tsproject.mapper;

import com.example.tsproject.entity.Answers;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface AnalysisStudentsMapper {
    @Select("SELECT a.id, a.stuNum, a.assignment_question_id, a.assignment_id, a.answer_content, a.trueOrfalse, q.chapter " +
            "FROM answers a " +
            "JOIN questions q ON a.assignment_question_id = q.id " +
            "WHERE a.assignment_id = #{assignmentId}")
    List<Map<String, Object>> findByAssignmentId(@Param("assignmentId") Integer assignmentId);
}
